package com.laomuji.android.mvvm.utils

import android.widget.Toast
import androidx.annotation.StringRes

/**
 * 自定义Toast
 * @author laomuji666
 * @since 2024/2/20
 */
object MyToast {
    fun makeText(text: String?) {
        if (text == null) {
            return
        }
        Toast.makeText(PackageUtil.getTopActivity(), text, Toast.LENGTH_SHORT)
            .show()
    }

    fun makeText(@StringRes resId: Int) {
        makeText(ResourceUtil.getString(resId))
    }
}